<?php
/* @var $this MapviewController */
if($opt){
$this->breadcrumbs=array(
	'Projects'=>array('project/index'),
	$project->name=>array('project/view','id'=>$project->id),
	'Show on Map('.$project->id.')',
);
}else{
$this->breadcrumbs=array(
	'Projects'=>array('project/index'),
	'Show on Map('.$project->id.')',
);
}
?>
<h1><?php echo $project->name; ?></h1>

<?php 
Yii::import('ext.egmap.*');
$gMap = new EGMap();
$gMap->zoom = 10;
$mapTypeControlOptions = array(
  'position'=> EGMapControlPosition::LEFT_BOTTOM,
  'style'=>EGMap::MAPTYPECONTROL_STYLE_DROPDOWN_MENU
);
$gMap->mapTypeControlOptions= $mapTypeControlOptions;
$arlatlong = explode(', ',$project->latlng);
$gMap->setCenter($arlatlong[0], $arlatlong[1]);
$icon = new EGMapMarkerImage(Yii::app()->request->baseUrl."/images/home.png");
$icon->setSize(32, 37);
$icon->setAnchor(16, 16.5);
$icon->setOrigin(0, 0);
$info_window_a = new EGMapInfoWindow('
<div>
<h3>'. $project->name .'</h3>
'. $project->subtitle .'<br>
'. CHtml::link('View..',array('project/view','id'=>$project->id)) .'<br>
</div>
');
$marker = new EGMapMarker($arlatlong[0], $arlatlong[1], array('title' => $project->name,'icon'=>$icon));
$marker->addHtmlInfoWindow($info_window_a);
$gMap->addMarker($marker);
$gMap->renderMap();
?>

